package main

import (
	"github.com/openGemini/openGemini/lib/util/lifted/influx/influxql"
	"github.com/vmihailenco/msgpack/v5"
	"log"
	"os"
)

func main() {
	content, err := os.ReadFile("query.txt")
	if err != nil {
		log.Fatal("err", err)
	}
	query := string(content)
	q, _ := influxql.ParseQuery(query)
	data, err := msgpack.Marshal(q)
	if err != nil {
		log.Fatal("dump err")
	}
	f, _ := os.OpenFile("./tmp", os.O_WRONLY|os.O_CREATE, 0777)
	f.Write(data)
	f.Close()
}
